package com.chinatgl.latte.app;

import android.content.Context;

import java.util.HashMap;

/**
 * 文件描述: 初始化
 * 作者: Created by 杨伟乔 on 2017/8/7 0007.
 * 版本号: 1.0
 */
@SuppressWarnings("all")
public final class Latte {

    public static Configurator init(Context context) {
        getConfigurations().put(ConfigKeys.APPLICATION_CONTEXT, context.getApplicationContext());
        return Configurator.getInstance();
    }

    public static HashMap<Object, Object> getConfigurations() {

        return Configurator.getInstance().getLatteConfig();
    }

    public static Context getApplication() {
        return (Context) getConfigurations().get(ConfigKeys.APPLICATION_CONTEXT);
    }

    public static <T> T getConfiguration(Object key) {
        return (T) getConfigurations().get(key);
    }

}
